<template>
  <div class="div-1">
      <div class="div-2">
          <div 
          class="Bang"
          v-for="(item,index) in tu"
          :class="{active:index==sel}"
          @click="ss(index)"
          >
              {{item.type}}
        </div>
      </div>
      
      <div 
         class="div-3"
         v-for="(nav,index) in cont"
         v-show="index==sel"
         >
         <div class="div-4">
             <img :src="nav.URL" alt="">
                <div class="div-4-1">
                    <p class="p-1"> {{nav.name}}</p>
                    <p class="p-2">第{{nav.pai}} 名</p>
                </div>
                 <div class="div-4-2">
                    <p class="p-3">邀请人数</p>
                    <p class="p-4">{{nav.yao}} </p>
                </div>
                 <div class="div-4-3">
                    <p class="p-3">佣金金额</p>
                    <p class="p-4">{{nav.yongjin}} </p>
                </div>
         </div>
         <div class="div-5">
             <div class="div-5-1">
                 <span>排名</span>
                 <span>姓名</span>
                 <span>邀请人数</span>
                 <span>佣金金额</span>
             </div>
             <div
              class="div-6"
              v-for="( item,index) in nav.data"
              >
                 <span>{{item.ming}} </span>
                
                <span class="span-2">
                     <img :src="item.URL" alt="">
                        {{item.name}}
                    </span>
                <span>{{item.renshu}}</span>
                <span>{{item.yongjin}}</span>
             </div>
         </div>
        <!-- {{nav.type}} -->
         </div>
  </div>
</template>

<script>
import nvhai from '../../../assets/nvhai.jpeg'
import labi from '../../../assets/labi.jpeg'
import luoli from '../../../assets/luoli.jpeg'
export default {
    data() {
        return {
            sel:0,
            tu:[{
                type:'日榜',
                
            },{
                type:'总榜',
                
            },],
            cont:[{
                URL:nvhai,
                name:'晓月',
                pai:'14',
                yao:"28",
                yongjin:"0.38",
                data:[{
                    ming:1,
                    URL:luoli,
                    name:'周刚发',
                    renshu:'15',
                    yongjin:"0.38",
                },{
                    ming:2,
                    URL:labi,
                    name:'周刚发',
                    renshu:'15',
                    yongjin:"0.38",
                },{
                    ming:3,
                    URL:nvhai,
                    name:'周刚发',
                    renshu:'15',
                    yongjin:"0.38",
                },]
            },{
                URL:luoli,
                name:'蜡笔',
                pai:'150',
                yao:"3",
                yongjin:"0.3",
                data:[{
                    ming:1,
                    URL:nvhai,
                    name:'蜡笔小',
                    renshu:'15',
                    yongjin:"0.38",
                },{
                    ming:2,
                    URL:luoli,
                    name:'周刚发',
                    renshu:'15',
                    yongjin:"0.38",
                },{
                    ming:3,
                    URL:labi,
                    name:'周刚发',
                    renshu:'15',
                    yongjin:"0.38",
                },]
            }]
        }
    },
    methods: {
        ss(index){
            this.sel=index
        }
    },
}
</script>

<style lang="less" scoped>
    .div-1{
        .div-2{
            display: flex;
            margin: 1rem 0 1rem 1rem;
            align-items: center;
            justify-content: center;
            width: 6rem;
            height: 1.5rem;
            border: 1px solid rgb(255, 255, 255);
            color: rgb(255, 255, 255);
            border-radius: 0.3rem;
            overflow: hidden;
           .Bang{
               width: 3rem;
               line-height: 1.5rem;
               font-size: 0.8rem;
               text-align: center;
           }
           
        }
        .div-3{
            .div-4{
                margin: 0 0.5rem;
                padding: 0.8rem;
                display: flex;
                align-items: center;
                justify-content: space-between;
                background-color: white;
                border-radius: 0.5rem;
                font-size: 1rem;
                img{
                    width: 3rem;
                    border-radius: 2rem;
                }
                .p-1{
                    font-size: 0.9rem;
                    font-weight: 600;
                    text-align: center;
                }
                .p-2{
                    font-size: 0.7rem;
                    color: #e97145;
                }
                .p-3{
                     font-size: 0.8rem;
                     color: #9a9a9a;
                }
                .p-4{
                    text-align: center;
                }
            }
            .div-5{
                margin: 1rem 0.5rem 0 0.5rem;
                padding: 0.8rem;
                background-color: white;
                border-radius: 0.5rem;
                font-size: 1rem;
                .div-5-1{
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-bottom: 1rem;
                    font-size: 0.8rem;
                    color: #9a9a9a;
                }
                .div-6{
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    text-align: center;
                    margin-bottom: 1rem;
                   .span-2{
                       font-size: 0.8rem;
                   }
                    img{
                        width: 2rem;
                        border-radius: 2rem;
                        border: 2px solid #feda59;
                        vertical-align: middle;
                    }
                }
            }
        }
    }
    .active{
               background-color: white;
               color: #f05121;
           }
</style>